home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / Demos / Bombardier_PC / DATACH.CST / 00217_Script_paramSprite < prev    next >
Text File  |  1999-03-07  |  2KB  |  51 lines

  1. property mySpritev, hiliteSpritev, myRectv
  2.  
  3. on new me
  4.   set mySpritev = the spriteNum of me
  5.   set hiliteSpritev = mySpritev -2
  6.   set myRectv = the rect of sprite mySpritev
  7.   
  8.   puppetSprite hiliteSpritev, true
  9.   set the loc of sprite hiliteSpritev = point(-1000, -1000)
  10.   
  11.   sendSprite((mySpritev - 1), #register, me)
  12.   return me
  13. end
  14.  
  15. on checkIfInsidev me
  16.   set myRectv = the rect of sprite mySpritev
  17.   set theMouseLoc = point(the mouseH, the mouseV)
  18.   if inside(theMouseLoc, myRectv) then
  19.     set myMember = the member of sprite mySpritev
  20.     set myTop = the top of sprite mySpritev
  21.     set theH = the left of sprite mySpritev
  22.     
  23.     set adjustedMouseV = (the mouseV - myTop)
  24.     set theLine = locVToLinePos(member myMember, adjustedMouseV)
  25.     set theV = linePosToLocV(member myMember, theLine)
  26.     set the loc of sprite hiliteSpritev = point(theH, (theV+myTop))
  27.     set the width of sprite hiliteSpritev = the width of member myMember
  28.   else
  29.     set the loc of sprite hiliteSpritev = point(-1000, -1000)
  30.   end if
  31.   
  32.   updateStage
  33. end
  34.  
  35. on getPlaneNamev me
  36.   set theMouseLoc = point(the mouseH, the mouseV)
  37.   if inside(theMouseLoc, myRectv) then
  38.     set hiliteV = the top of sprite hiliteSpritev - the top of sprite mySpritev
  39.     set myMember = the member of sprite mySpritev
  40.     set theLine = locVToLinePos(member myMember, hiliteV)
  41.     set theText = the text of member myMember
  42.     set textLine = line theLine of theText
  43.     set the loc of sprite hiliteSpritev = point(-1000,-1000)
  44.   else 
  45.     set textLine = ""
  46.   end if
  47.   
  48.   
  49.   return textLine
  50. end
  51.